package mycoffee.order.model;

import android.text.TextUtils;
import mycoffee.order.activity.MyCoffeeApplication;

public class ExRoot extends Root {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 
	 */
	protected String mName;
	protected String mName_vi;
	protected String mName_en;
	protected String mName_de;
	protected String mDescription;
	protected String mDescription_vi;
	protected String mDescription_en;
	protected String mDescription_de;

	/**
	 * Constructor with no input parameter
	 */
	public ExRoot() {
		super();
	}

	public ExRoot(ExRoot category) {
		this.mName = category.getName();
		this.mName_vi = category.getName_vi();
		this.mName_en = category.getName_en();
		this.mName_de = category.getName_de();
		this.mDescription = category.getDescription();
		this.mDescription_vi = category.getDescription_vi();
		this.mDescription_en = category.getDescription_en();
		this.mDescription_de = category.getDescription_de();
	}

	public String getName() {
		return mName;
	}

	/**
	 * get name of this object based on current language.
	 * 
	 * @return
	 */
	public String getNameFollowCurrentLanguage() {
		String name = "";
		switch (MyCoffeeApplication.mLanguage) {
		case Constants.LANGUAGE_VN:
			name = mName_vi;
			break;
		case Constants.LANGUAGE_EN:
			name = mName_en;
			break;
		case Constants.LANGUAGE_DE:
			name = mName_de;
			break;
		default:
			break;
		}
		if (TextUtils.isEmpty(name)) {
			name = mName;
		}
		return name;
	}

	/**
	 * get description of this object based on current language.
	 * 
	 * @return
	 */
	public String getDescriptionFollowCurrentLanguage() {
		String description = mDescription;
		switch (MyCoffeeApplication.mLanguage) {
		case Constants.LANGUAGE_VN:
			description = mDescription_vi;
			break;
		case Constants.LANGUAGE_EN:
			description = mDescription_en;
			break;
		case Constants.LANGUAGE_DE:
			description = mDescription_de;
			break;
		default:
			break;
		}
		if (TextUtils.isEmpty(description)) {
			description = mDescription;
		}
		return description;
	}

	public void setName(String name) {
		mName = name;
	}

	public String getName_vi() {
		return mName_vi;
	}

	public void setName_vi(String name_vi) {
		mName_vi = name_vi;
	}

	public String getName_en() {
		return mName_en;
	}

	public void setName_en(String name_en) {
		mName_en = name_en;
	}

	public String getName_de() {
		return mName_de;
	}

	public void setName_de(String name_de) {
		mName_de = name_de;
	}

	public String getDescription() {
		return mDescription;
	}

	public void setDescription(String description) {
		mDescription = description;
	}

	public String getDescription_vi() {
		return mDescription_vi;
	}

	public void setDescription_vi(String description_vi) {
		mDescription_vi = description_vi;
	}

	public String getDescription_en() {
		return mDescription_en;
	}

	public void setDescription_en(String description_en) {
		mDescription_en = description_en;
	}

	public String getDescription_de() {
		return mDescription_de;
	}

	public void setDescription_de(String description_de) {
		mDescription_de = description_de;
	}

}
